#include "../inc/sched.h"

/*
 * Perform scheduler related setup for a newly forked process p.
 * p is forked by current.
 *
 * __sched_fork() is basic setup which is also used by sched_init() to
 * initialize the boot CPU's idle task.
 */
static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
{
    p->on_rq = 0;

    init_fair_entity(p);

    init_rt_entity(p);

    init_dl_entity(p);
}

static inline void __copy_sched_params(struct task_struct *p, struct task_struct *curr)
{
    p->normal_prio = curr->normal_prio;
    p->static_prio = curr->static_prio;
    /*
     * Make sure we do not leak PI boosting priority to the child.
     */
    p->prio = curr->normal_prio;

    p->se.slice = curr->se.slice;
    p->se.load = curr->se.load;
}
